<%@page import="dao.BookDao"%>
<%@page import="entity.Book"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page errorPage="error.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" charset="utf-8" />
    </head>
    <body>
        <div class="container">
                <h1 class="text-primary text-center">搜索结果</h1>
                <br>
                <div style="position:absolute;right:400px;top:30px"><a href="Admin.jsp" class="btn btn-sm btn-warning">返回</a></div>
                <br>
                <table class="table table-condensed table-striped" style="width: 900px">
                    <tr><th>书名</th><th>作者</th><th>出版社</th><th>编号</th><th>类型</th><th></th><th></th></tr>
                <%
                    String keyword=request.getParameter("keyword");
                    %>
                    <%
                    List<Book> list1=new BookDao().getUndeletedBookByKeyword(keyword);

                    %>

                    <%
                    for(Book book:list1){
                %>
                    <tr><td><%=book.getBookName()%></td><td><%=book.getAuthor()%></td><td><%=book.getPublishHouse()%></td><td><%=book.getId()%></td><td><%=book.getType()%></td>
                        <td><a href="BookInfo.jsp?bookid=<%=book.getId()%>" target="_blank">查看详情</a></td>
                        <td><a href="dbs?bookid=<%=book.getId()%>">删除图书</a></td></tr>
                    <%
                        }
        %></table>
        </div>
    </body>
</html>
